package org.hackystat.ambientdevice.xml;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.hackystat.ambientdevice.server.jaxb.Configuration;
import org.junit.Test;

/** 
 * Test file for the Configuration saver.
 * @author Sonwright M. Gomez
 *
 */
public class TestConfigurationSaver {

  /**
   * Tests loader.
   * 
   * @throws Exception if problem occurs.
   */
  @Test
  public void testConfigurationSaver() throws Exception {
    Configuration configuration = null;
    String configLocation = System.getProperty("user.dir") + "/xml/test/configuration.test.xml";
    ConfigurationLoader cl = new ConfigurationLoader(configLocation);
    ConfigurationSaver cs = new ConfigurationSaver();
    configuration = cl.getConfiguration();
    assertNotNull("test saver", cs);
    assertTrue("test if saver creates file in correct directory", 
        cs.saveConfigurationXml(configuration));
  }
}
